package cn.com.coding.system.service.impl;

import cn.com.coding.common.utils.PageUtil;
import cn.com.coding.common.utils.Query;
import cn.com.coding.system.dao.ProductImageDao;
import cn.com.coding.system.domin.ProductImageEntity;
import cn.com.coding.system.service.ProductImageService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("productImageService")
public class ProductImageServiceImpl extends ServiceImpl<ProductImageDao, ProductImageEntity> implements ProductImageService {

    @Override
    public PageUtil queryPage(Map<String, Object> params) {
        IPage<ProductImageEntity> page = this.page(new Query<ProductImageEntity>().getPage(params),
                new QueryWrapper<ProductImageEntity>()
                        .eq("product_pid", params.get("product_pid")));

        return new PageUtil(page);
    }

}